//
//  UIView+Constraint.h
//  YunDongGym
//
//  Created by lqq on 2018/5/24.
//  Copyright © 2018年 lqq. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Constraint)


#pragma mark 添加UIView
/**
 添加UIView
 */
- (UIView *)addViewWithEdgeInsets:(UIEdgeInsets)edgeInsets
                        backColor:(UIColor *)backColor;


/**
 添加View，固定高度在顶部
 */
- (UIView *)addViewKeepTopWithHeight:(CGFloat)height
                            topSpace:(CGFloat)topSpace
                           leftSpace:(CGFloat)leftSpace
                          rightSpace:(CGFloat)rightSpace
                           backColor:(UIColor *)backColor;

/**
 添加View，固定高度在底部
 */
- (UIView *)addViewKeepBottomWithHeight:(CGFloat)height
                            bottomSpace:(CGFloat)bottomSpace
                              leftSpace:(CGFloat)leftSpace
                             rightSpace:(CGFloat)rightSpace
                              backColor:(UIColor *)backColor;

/**
 添加View，固定高度在左边
 */
- (UIView *)addViewKeppLeftWithWidth:(CGFloat)width
                           leftSpace:(CGFloat)leftSpace
                            topSpace:(CGFloat)topSpace
                         bottomSpace:(CGFloat)bottomSpace
                           backColor:(UIColor *)backColor;

/**
 添加View，固定高度在右边
 */
- (UIView *)addViewKeepRightWithWidth:(CGFloat)width
                           rightSpace:(CGFloat)rightSpace
                             topSpace:(CGFloat)topSpace
                          bottomSpace:(CGFloat)bottomSpace
                            backColor:(UIColor *)backColor;



/**
 添加底部横线
 */
- (UIView *)addBottomLineViewWithLeftSpace:(CGFloat)leftSpace
                                rightSpace:(CGFloat)rightSpace;


#pragma mark 添加UILabel
/**
 添加UILabel居中
 */
- (UILabel *)addCenterLabelWithText:(NSString *)text
                            textColor:(UIColor *)textColor
                                 font:(UIFont *)font;

/**
 添加UILabel垂直居中靠左
 */
- (UILabel *)addVCenterLabelKeepLeft:(CGFloat)leftSpace
                                            text:(NSString *)text
                                       textColor:(UIColor *)textColor
                                            font:(UIFont *)font;

/**
 添加UILabel垂直居中靠右
 */
- (UILabel *)addVCenterLabelKeepRight:(CGFloat)rightSpace
                                             text:(NSString *)text
                                        textColor:(UIColor *)textColor
                                             font:(UIFont *)font;


/**
 添加label靠上和左
 */
- (UILabel *)addLabelKeepTop:(CGFloat)topSpace
                        left:(CGFloat)leftSpace
                        text:(NSString *)text
                   textColor:(UIColor *)textColor
                        font:(UIFont *)font;


#pragma mark 添加UIImageView

/**
 添加UIImageView垂直居中靠左
 */
- (UIImageView *)addVCenterImageViewKeepLeft:(CGFloat)leftSpace
                                       width:(CGFloat)width
                                      height:(CGFloat)height
                                   imageName:(NSString *)imageName;
/**
 添加UIImageView垂直居中靠右
 */
- (UIImageView *)addVCenterImageViewKeepRight:(CGFloat)rightSpace
                                       width:(CGFloat)width
                                      height:(CGFloat)height
                                   imageName:(NSString *)imageName;



@end
